﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ChangeProblemLogic.cs
{
    public class ChangeProblemM
    {
        public int[] GetChange(decimal change, decimal[] money, int[] numberOfMoney)
        {
            //获取各类面币的数量
           for(int i = 0; i < money.Length; i++)
            {
                numberOfMoney[i] = (int)(change / money[i]);
                change = change - numberOfMoney[i] * money[i];
            }          
            return numberOfMoney;
        }

        //计算店家应找回的钱
        public decimal getBalance(decimal totalMoney, decimal giveMoney)
        { 
            return giveMoney - totalMoney;
        }
    }
}
